utils.py: fix types in docstrings for base64url_encode/decode#269
utils.py: fix types in docstrings for base64url_encode/decode#269asherf merged 1 commit intompdavis:masterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #269 +/- ##
=======================================
Coverage 92.94% 92.94%
=======================================
Files 15 15
Lines 1418 1418
=======================================
Hits 1318 1318
Misses 100 100 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
good fix for the same issue I'm having with PyCharm warning that I'm passing bytes as well as my initial confusion getting an exception when passing a string. I'm not sure why this PR hasn't been merged yet. |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the docstring parameter types for the base64url_encode and base64url_decode helpers to correctly reflect that they operate on bytes, not strings.
- Changed the
inputparameter type in both functions fromstrtobytesin docstrings. - Adjusted descriptions to indicate byte inputs rather than string inputs.
|
|
||
| Args: | ||
| input (str): A base64url_encoded string to decode. | ||
| input (bytes): A base64url_encoded string (bytes) to decode. |
There was a problem hiding this comment.
[nitpick] The docstring repeats the type and uses 'base64url_encoded string'; consider simplifying to bytes: base64url-encoded value to decode.
| input (bytes): A base64url_encoded string (bytes) to decode. | |
| input (bytes): base64url-encoded value to decode. |
|
|
||
| Args: | ||
| input (str): A base64url_encoded string to encode. | ||
| input (bytes): A base64url_encoded string (bytes) to encode. |
There was a problem hiding this comment.
The description incorrectly implies the input is already encoded. It should read something like bytes: raw data to encode using base64url.
| input (bytes): A base64url_encoded string (bytes) to encode. | |
| input (bytes): Raw binary data (bytes) to encode using base64url. |
No description provided.